# Contributor: Coco Liliace <coco@liliace.dev>
# Maintainer: Coco Liliace <coco@liliace.dev>
pkgname=aercbook
pkgver=0.1.5
pkgrel=1
pkgdesc="Minimalistic address book for aerc"
url="https://sr.ht/~renerocksai/aercbook/"
arch="aarch64 x86_64"
license="MIT"
makedepends="zig"
options="!check" # no tests
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~renerocksai/aercbook/archive/v$pkgver.tar.gz
	0001-zig-0.12-std.ChildProcess.exec-run.patch
	0002-zig-0.12-convert-some-vars-to-consts.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"

# We may want other than "baseline" for other targets, when enabled by zig
case "$CARCH" in
	aarch64|x86_64) cputarget=baseline ;;
esac

build() {
	zig build -Doptimize=ReleaseSafe ${cputarget:+-Dcpu="$cputarget"}
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin ./zig-out/bin/aercbook
}

sha512sums="
ffabe7017e5d15df2cf19fa7663b045a7e693acfd34d25a85aa22235ed1f02d5ea40cee2cd0ff9f35d0ad497aefcde5048097365b7037c06c95729cf29d46614  aercbook-0.1.5.tar.gz
d6c164144d7296df949d24a876ae45e72236efdc1c0997ffe079125ae13794e78c60ffcee3d6d9b33dc5d6021225da27a9e6ba2669d8d4b53939b977e4de1255  0001-zig-0.12-std.ChildProcess.exec-run.patch
81ed9206b6530fd072732bb9587a3a8ad2c89518203ce49bc225799a06a30548e3654a16cf63bb16db4a6afa1be1c8394317c0b003eaa95eb982fca604f1489c  0002-zig-0.12-convert-some-vars-to-consts.patch
"
